package com.chhuang.system.po;

import java.io.Serializable;
import com.chhuang.core.model.AbstractPersistentModel;
import com.chhuang.core.validation.ValidGroupSave;
import com.chhuang.core.validation.ValidGroupUpdate;
import com.sun.xml.bind.CycleRecoverable;
import org.springframework.format.annotation.DateTimeFormat;
import com.alibaba.fastjson.annotation.JSONField;
import javax.validation.constraints.*;

/**
* ChRole Model
* @author ChHuang
* @date Thu Mar 09 09:01:29 CST 2017
*/
public class ChRole extends AbstractPersistentModel implements CycleRecoverable{
	private static final long serialVersionUID = 824337070067102043L;
	@NotNull(message="{ChRole.roleId.NotNull}",groups={ValidGroupUpdate.class})
	@Size(max=32,message="{ChRole.roleId.Size}",groups={ValidGroupSave.class})
	private String roleId;
	public String getRoleId(){
		return roleId;
	}
	public void setRoleId(String roleId){
		this.roleId=roleId;
	}
	@Size(max=32,message="{ChRole.roleName.Size}",groups={ValidGroupSave.class})
	private String roleName;
	public String getRoleName(){
		return roleName;
	}
	public void setRoleName(String roleName){
		this.roleName=roleName;
	}
	private Integer roleOrder;
	public Integer getRoleOrder(){
		return roleOrder;
	}
	public void setRoleOrder(Integer roleOrder){
		this.roleOrder=roleOrder;
	}
	@Override
	public Serializable getId() {
		return getRoleId();
	}
	@Override
	public void setId(Serializable id) {
		setRoleId((String)id);
	}
	@Override
	public Object onCycleDetected(Context arg0) {
		ChRole temp=new ChRole();
		temp.setRoleId(roleId);
		return temp;
	}
	@Override
	public String toString() {
		return "ChRole [roleId="+roleId+",roleName="+roleName+",roleOrder="+roleOrder+"]";
	}
}